
import React from 'react';

import Header from "./Header"
import ContentNavi from "./ContentNavi"
import MenuSettingBody from "./MenuSettingBody"

import * as ApiMsgAction  from '../actions/ApiMsgAction';
import { connect }  from 'react-redux';

class MenuSettingPanel extends React.Component {

  componentDidUpdate() {
    if (this.props.apiMsg && this.props.apiMsg.length > 0) {
      alert(this.props.apiMsg)
      this.props.dispatch(
        ApiMsgAction.clearApiMsgAction()
      )
    }
  }

  render() {
      return (
        <div className="main-panel" >
          <div className="content" >
            <ContentNavi title="自定义菜单" />
            <MenuSettingBody
              property = {this.props.initialState.sysuser.WorkingProperty}
              wechat = {this.props.wechat}/>
          </div>
        </div>
      );
  }
}

const mapStateToProps = (state, ownProps) => {
  // console.log(state)
  return {
          apiMsg: state.apiMsg
         }
}

export default connect(mapStateToProps)(MenuSettingPanel)
